#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>

int main()
{
	char arr1[50];
	int i;
	gets(arr1);
	for (i = 0; arr1[i] != '#'; i++)
	{
		if (arr1[i] >= 'a' && arr1[i] <= 'z')
			arr1[i] -= 32;
		else if (arr1[i] >= 'A' && arr1[i] <= 'Z')
			arr1[i] += 32;


	}
	for (i = 0; arr1[i] != '#'; i++)
	{
		printf("%c", arr1[i]);
	}

	return 0;
}
